package net.osc.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import net.osc.util.PageBean;

public interface HibernateDao {

	public void save(Object entity);

	public void delete(Object entity);

	public int bulkUpdate(String hql, Object... values);

	public int bulkUpdateBySQL(final String sql, final Object... values);

	public <T> T get(Class<T> clazz, Serializable id);
	
	public <T> List<T> getAll(Class<T> clazz);
	
	public <T> T load(Class<T> clazz, Serializable id);

	public <T> List<T> find(String hql, Object... values);
	
	public <T> List<T> find(String hql, String[] paramNames, Object[] params);
	
	public <T> List<T> find(String hql, String[] paramNames, Object[] params,
			String[] listParamNames, Collection<?>[] listParams);

	public <T> T findUniqueResult(String hql, Object... values);

	public <T> List<T> findBySQL(String sql, Object... values);

	public <T> List<T> findBySQL(String sql, String[] paramNames, Object[] params);

	public <T> List<T> findBySQL(String sql, String[] paramNames, Object[] params,
			String[] listParamNames, Collection<?>[] listParams);

	public <T> T findBySQLUniqueResult(String sql, Object... values);

	public <T> PageBean<T> findByPage(PageBean<T> pageBean, String hql, Object... values);
	
	public <T> PageBean<T> findByPage(PageBean<T> pageBean, String hql, String[] paramNames,
			Object[] params);

	public <T> PageBean<T> findByPage(PageBean<T> pageBean, String hql, String[] paramNames,
			Object[] params, String[] listParamNames, Collection<?>[] listParams);
	
	public <T> PageBean<T> findBySQLPage(PageBean<T> pageBean, String sql, Object... values);

	public <T> PageBean<T> findBySQLPage(PageBean<T> pageBean, String sql, String[] paramNames,
			Object[] params);

	public <T> PageBean<T> findBySQLPage(PageBean<T> pageBean, String sql, String[] paramNames,
			Object[] params, String[] listParamNames, Collection<?>[] listParams);

}
